#define _CRT_SECURE_NO_WARNINGS 1
#include<string>
#include<vector>
#include<iostream>
using namespace std;
class Solution {
public:
    vector<string> ret;
    string path;
    void dfs(string& s)
    {
        if (path.size() == s.size())
        {
            ret.push_back(path);
            return;
        }
        char ch = s[path.size()];
        path.push_back(ch);
        dfs(s);
        path.pop_back();

        if (ch >= '0' && ch <= '9') return;

        if (ch >= 'a' && ch <= 'z') path.push_back(ch - 32);
        else if (ch >= 'A' && ch <= 'Z') path.push_back(ch + 32);
        dfs(s);
        path.pop_back();
    }
    vector<string> letterCasePermutation(string s) {
        dfs(s);
        return ret;
    }
};